<?php

$result=array();

		if(!isset($_POST['userid'])||!isset($_POST['orgid'])||!isset($_POST['inventorys'])){
			$result['stat']=0;
			echo json_encode($result);
	 		 return;
		}
		$inventorys=$_POST['inventorys'];
		$user1=$_POST['userid'];
		$org=$_POST['orgid'];
		$error=array();

		foreach($inventorys as $inv){
			$tran_id=$inv['hide'];		
			$r=distributeConfirm($user1,$tran_id,$org);
			if(!$r){
				array_push($error,$tran_id);				
			}
				
		
		}
		
		$result['stackedNum']=count($inventorys)-count($error);
		$result['failededNum']=count($error);
		$result['error']=$error;
		$result['stat']=1;
		echo json_encode($result);
	 	return;
?>